// index.js
// 获取应用实例
const app = getApp()
import {
  getBannerPort,
  getCatitemsPort,
  getFloorPort
} from '../../http/http'
Page({
  data: {
    value: '',
    topp:0
  },
  onReachBottom(){
    console.log('--------bottom');
  },
  onPullDownRefresh(){
    console.log('-------top');
  },
  toppFn(){
    console.log('-----');
    this.setData({
      topp:0
    })
  },
  changeFnn(data) {
    // console.log('++++++++', data);
    this.setData({
      value: data.detail
    })
  },
  onChange(e) {
    this.setData({
      value: e.detail,
      bannerLise: [],
      catesList: [],
      floorList: []
    });
  },
  onSearch() {
    Toast('搜索' + this.data.value);
  },
  onClick() {
    Toast('搜索' + this.data.value);
  },
  async getFloorList() {
    let res = await getFloorPort()
    // console.log(res);
    this.setData({
      floorList: res.data.message
    })
  },

  async getCateList() {
    let res = await getCatitemsPort()
    // console.log(res);
    this.setData({
      catesList: res.data.message
    })
  },
  async getBannerFn() {
    let res = await getBannerPort()
    // console.log(res.data.message);
    this.setData({
      bannerLise: res.data.message
    })
  },
  onLoad() {
    this.getBannerFn()
    this.getCateList()
    this.getFloorList()
  },


})